export default {
  data() {
    return {
      // 默认的全局分享内容
      share: {
        title: "Rapid让彼达中美物流集运 1KG起拼！",
        path: "/pages/tabBar/home", // 全局分享的路径，比如 首页
        imageUrl: "https://jyapi.rapidship.cn/public/temporary/logo.png", // 全局分享的图片(可本地可网络)
      },
    };
  },
  // 定义全局分享
  // 1.发送给朋友
  onShareAppMessage(res) {
	  // this.$api.post({
	  //   url: "/ebapi/public_api/get_logo_url",
	  //   success: (res) => {
			// this.share.imageUrl = res.logo_url
	  //   },
	  // })	
	  let ppid = uni.getStorageSync("userInfo") && uni.getStorageSync("userInfo").uid || '';
	  let imageUrl = uni.getStorageSync("logo") || this.share.imageUrl;
	  console.log(ppid,"ppid",`${this.share.path}?ppid=${ppid}`)
	  return {
	    title: this.share.title,
	    path: `${this.share.path}?ppid=${ppid}`,
	    imageUrl: imageUrl,
	  };
  },
  //2.分享到朋友圈
  onShareTimeline(res) {
	  let imageUrl = uni.getStorageSync("logo") || this.share.imageUrl;
    return {
      title: this.share.title,
      path: this.share.path,
      imageUrl: imageUrl,
    };
  },
};
